<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Game */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="game-form">

    <?php $form = ActiveForm::begin(); ?>
    <?php if(empty($model->uid)){ ?>
        <?= Html::a(Yii::t('app', '选择用户'), ['people/index'], ['class' => 'btn btn-success']) ?>
    <?php }else{ ?>
        <?= $form->field($model, 'uid')->dropDownList(\yii\helpers\ArrayHelper::map(\app\models\People::find()->where(['id'=>$model->uid])->all(),'id','mobile'), ['prompt'=>'请选择','style'=>'width:200px']) ?>
    <?php } ?>

    <?= $form->field($model, 'role_id')->radioList(\yii\helpers\ArrayHelper::map(\app\models\Role::find()->all(),'id','name')) ?>

    <?= $form->field($model, 'win')->radioList(\yii\helpers\ArrayHelper::map(\app\models\Win::find()->all(),'id','name')) ?>

    <div class="form-group">
        <?php if(empty($model->uid)){ ?>
            <?= Html::a(Yii::t('app', '选择用户'), ['people/index'], ['class' => 'btn btn-success']) ?>
        <?php }else{ ?>
            <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
        <?php } ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
